'''
Author: wangyingjie 2778809626@qq.com
Date: 2025-07-14 16:13:22
LastEditors: wangyingjie 2778809626@qq.com
LastEditTime: 2025-07-20 10:38:32
FilePath: /two_wheeled_car/src/bot_control/launch/all.launch.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''

import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    # 获取当前包的路径
    pkg_dir = get_package_share_directory('bot_control')
    
    # 创建节点
    sensor_reader_node = Node(
        package='bot_control',
        executable='sensor_reader',
        name='sensor_reader',
        output='screen'
    )
    
    keyboard_control_node = Node(
        package='bot_control',
        executable='keyboard_control',
        name='keyboard_control',
        output='screen',
        prefix='xterm -e'  # 确保键盘输入有效
    )

    gazebo_target_selector_node = Node(
        package='bot_control',
        executable='gazebo_target_selector',
        name='gazebo_target_selector',
        output='screen',
        prefix='xterm -e'  # 确保键盘输入有效
    )
    
    return LaunchDescription([
        sensor_reader_node,
        keyboard_control_node
    ])